<template>
    <div>
        <h3>优惠券核销列表</h3>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>酒店名称</td>
                    <td>会员名称</td>
                    <td>优惠券名称</td>
                    <td>使用时间</td>
                    <td>操作</td>
                </tr>
                <tr v-for="item in data.list">
                    <td>{{item.ShopName}}</td>
                    <td>{{item.UserName}}</td>
                    <td>
                        <span v-if="item.DiscountT==1">代金券</span>
                        <span v-if="item.DiscountT==2">折扣券</span>
                        <span v-if="item.DiscountT==3">兑换券</span>
                    </td>
                    <td>{{moment(item.UseTime).format("YYYY-MM-DD HH:mm:ss")}}</td>
                    <td></td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';
import moment from 'moment';
const router = useRouter();
const route = useRoute();

onMounted(() => {
    show();
})

let data: any = reactive({
    list: []
})

const show=()=>{
    axios({
        url:'api/Discount/GetDisCountlist',
        method:'get'
    })
    .then((res)=>{
    data.list=res.data
    })
}







</script>

<style scoped></style>